{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1bfa3571",
   "metadata": {},
   "outputs": [],
   "source": [
    "%%html\n",
    "<!-- （勿改动，执行即可）执行更改背景 -->\n",
    "<link rel=\"stylesheet\" href=\"exam.css\" type=\"text/css\">\n",
    "<h1 style=\"color: red;\">注意单元格的变量名不能改动，否则会影响自动打分</h1>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e1fd9105",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 始000（勿改动，执行即可） win系统执行\n",
    "e = %env\n",
    "_which_= \"A\"  # 卷号\n",
    "import PandasCourse as PC\n",
    "from IPython.display import Markdown\n",
    "Markdown(PC.msgs['opening'].format(w=_which_, d=e['HOMEDRIVE']+ e['HOMEPATH']))    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "98cda111",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 始000（勿改动，执行即可） mac系统执行\n",
    "e = %env\n",
    "_which_= \"A\"  # 卷号\n",
    "import PandasCourse as PC\n",
    "from IPython.display import Markdown\n",
    "Markdown(PC.msgs['opening'].format(w=_which_, d=\"\"))    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff53c723",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 始001（✍请改动並执行）\n",
    "student_id = \"\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e5993c5",
   "metadata": {},
   "source": [
    "#  🙊🙈🙉 Python 🙉🙈🙊 \n",
    "# 读入数据\n",
    "* 以下代码是读入相关文本数据\n",
    "* 所有文本数据赋值给text\n",
    "* 以下考题皆为针对此text做相关操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "54c740ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_html(\"CNKI-20221106233042609.xls\")[0]\n",
    "text = ''.join(df[6].to_list())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c266c3de",
   "metadata": {},
   "source": [
    "## Q1（20分） 🌶 易\n",
    "* 查找\"NFT\"的次数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b599db98",
   "metadata": {},
   "outputs": [],
   "source": [
    "phrase = #✍\n",
    "freq_table_phrase= #✍\n",
    "freq_table_phrase"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "24a17265",
   "metadata": {},
   "source": [
    "## Q2（20分） 🌶 易\n",
    "* 用中文\"。\"拆分,生成list_split列表，每一个句子是一个独立的列表元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "81f149ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "list_split = #✍\n",
    "list_split"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "959c725a",
   "metadata": {},
   "source": [
    "## Q3 （20分） 🌶 易\n",
    "* 在Q2题目中的基础上取出第20个句子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e65cc62",
   "metadata": {},
   "outputs": [],
   "source": [
    "the_20_phrase = #✍\n",
    "the_20_phrase"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58f0d944",
   "metadata": {},
   "source": [
    "# 😸 🤠 😺   深呼吸  😺 🤠 😸\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "806ea1f7",
   "metadata": {},
   "source": [
    "## Q4 （20分） 🌶🌶  中\n",
    "* 在Q2题目的基础上找出所有包含\"NFT\"的句子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4d1f4814",
   "metadata": {},
   "outputs": [],
   "source": [
    "content_all = []\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "content_all"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "820b0f51",
   "metadata": {},
   "source": [
    "# 👽👼🤶  你可以的  🤶👼👽\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "661c5491",
   "metadata": {},
   "source": [
    "## Q5 （20分） 🌶🌶  中\n",
    "* 统计text中所有<font color=\"red\">[\"NFT\",\"web3.0\",\"二级市场\",\"以太坊\",\"创作者\",\"加密货币\",\"区块链\",\"数字作品\",\"数字资产\",\"智能合约\",\"联盟链\",\"比特币\",\"元宇宙\",\"博物馆\",\"数字孪生\",\"数字经济\",\"数字藏品\",\"文化数字化\",\"版权保护\",\"人工智能\",\"加密艺术\",\"数字艺术\",\"独创性\",\"去中心化\",\"版权\",\"著作权\",\"虚拟财产\"]</font>出现的次数，并以其名称作为KEY，次数作为Value创建词频字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "520b3606",
   "metadata": {},
   "outputs": [],
   "source": [
    "found = {}\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "found"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e2e836b",
   "metadata": {},
   "source": [
    "## Q6 （20分） 🌶 🌶 🌶 加分题\n",
    "* 尝试找出所有 \"区块链\" 前面两个关键字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a94a8829",
   "metadata": {},
   "outputs": [],
   "source": [
    "NFT_forward_two = []\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "#✍#✍#✍\n",
    "NFT_forward_two"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a93e3a5",
   "metadata": {},
   "source": [
    "# 🙌🙌🙌🎈 👍 恭喜 👍 🎉🙌🙌🙌\n",
    "# 🏁🏁🏁回报答题分数（仅供参考）🏁🏁🏁"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "720befdb",
   "metadata": {},
   "outputs": [],
   "source": [
    "#终001 （勿改动，执行即可）回报答题分数\n",
    "import PandasCourse as PC\n",
    "\n",
    "score_details = PC.score_answers(locals(), _which_)\n",
    "print (score_details[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0b97d745",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
